import com.alibaba.druid.filter.config.ConfigTools;
import com.hao.wms.domain.Employee;
import com.hao.wms.service.IEmployeeService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Arrays;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class App {
    @Test
    public void test() throws Exception {
        String pwd = ConfigTools.encrypt("123456");
        System.out.println(pwd);//Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg==
    }
    @Autowired
    private IEmployeeService employeeService;

    @Test
    public void test1() throws Exception{
        for (int i=0;i<=5;i++){
            Employee e = new Employee();
            e.setName("test"+i);
            employeeService.save(e);

        }
    }
    @Test
    public void test2() throws Exception{
        employeeService.batchDelete(Arrays.asList(20L,21L,22L));
    }

}
